/**
 * Created with IntelliJ IDEA
 * Description:
 * User:恋恋
 * Date:2022-03-21
 * Time:23:38
 */
import java.util.Scanner;
public class Teat {
    public static int pri(int a){
        //循环的起始条件是递归的终止条件
        if(a<10){
            System.out.print(a);
            System.out.print(" ");
            return 0;//终止的关键条件，注意递归都有返回值
        }
        pri(a/10);//取出商123//12//1
        System.out.print(a%10+" ");//取出最后一位---1 2 3 4
        return 0;
    }
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        System.out.print("请输入一个数字：");
        int num= in.nextInt();
        pri(num);
    }
}
